home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / grafik / bildanzeiger / superview-lib_dev / example_tools / newinfolist / nl_subs.c < prev    next >
C/C++ Source or Header  |  1995-03-09  |  2KB  |  58 lines

  1. /* ======================================================================== */
  2. /* = Programmname    : SimpleView_Subs V3.3                               = */
  3. /* =                                                                      = */
  4. /* ======================================================================== */
  5. /* = Autor/Copyright : (c) 1990-94 by Andreas Ralph Kleinert.             = */
  6. /* =                   All rights reserved.                               = */
  7. /* ======================================================================== */
  8. /* = Funktion        : Sub-Routines for SimpleView V3.3                   = */
  9. /* =                                                                      = */
  10. /* ======================================================================== */
  11. /* = Compiler        : SAS/C V6.5                                         = */
  12. /* =                                                                      = */
  13. /* ======================================================================== */
  14.  
  15. #include <dos.h> /* to prevent multiple include, include this at FIRST ! */
  16.  
  17. #include <exec/types.h>
  18. #include <exec/memory.h>
  19.  
  20. #include <proto/exec.h>
  21. #include <proto/dos.h>
  22.  
  23. #include <stdio.h>
  24. #include <stdlib.h>
  25. #include <string.h>
  26.  
  27.  
  28. #define N (NULL) /* as usual */
  29.  
  30.  
  31. void __stdargs K_Printf(char *formatstring, ...);
  32.  
  33.  
  34. /* *************************************************** */
  35. /* *                                                 * */
  36. /* * K_Printf : Replacement for printf()-Output      * */
  37. /* *                                                 * */
  38. /* *************************************************** */
  39.  
  40. #define KIP_BUFLEN (1200)
  41.  
  42. extern void Fmt(void);
  43.  
  44. void __stdargs K_Printf(char *formatstring, ...)
  45. {
  46.  UBYTE *buffer;
  47.  
  48.  buffer = (UBYTE *) AllocMem(KIP_BUFLEN, MEMF_CLEAR);
  49.  if(buffer)
  50.   {
  51.    RawDoFmt((APTR) formatstring, (APTR) (((ULONG *)&formatstring)+1), (APTR) &Fmt, (APTR) buffer);
  52.  
  53.    Write(Output(), buffer, strlen(buffer));
  54.  
  55.    FreeMem(buffer, KIP_BUFLEN);
  56.   }
  57. }
  58.